<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/**
<span class='line'>  2</span>  * Constructs a new bar mark with default properties. Bars are not typically
<span class='line'>  3</span>  * constructed directly, but by adding to a panel or an existing mark via
<span class='line'>  4</span>  * {@link pv.Mark#add}.
<span class='line'>  5</span>  *
<span class='line'>  6</span>  * @class Represents a bar: an axis-aligned rectangle that can be stroked and
<span class='line'>  7</span>  * filled. Bars are used for many chart types, including bar charts, histograms
<span class='line'>  8</span>  * and Gantt charts. Bars can also be used as decorations, for example to draw a
<span class='line'>  9</span>  * frame border around a panel; in fact, a panel is a special type (a subclass)
<span class='line'> 10</span>  * of bar.
<span class='line'> 11</span>  *
<span class='line'> 12</span>  * &lt;p>Bars can be positioned in several ways. Most commonly, one of the four
<span class='line'> 13</span>  * corners is fixed using two margins, and then the width and height properties
<span class='line'> 14</span>  * determine the extent of the bar relative to this fixed location. For example,
<span class='line'> 15</span>  * using the bottom and left properties fixes the bottom-left corner; the width
<span class='line'> 16</span>  * then extends to the right, while the height extends to the top. As an
<span class='line'> 17</span>  * alternative to the four corners, a bar can be positioned exclusively using
<span class='line'> 18</span>  * margins; this is convenient as an inset from the containing panel, for
<span class='line'> 19</span>  * example. See {@link pv.Mark} for details on the prioritization of redundant
<span class='line'> 20</span>  * positioning properties.
<span class='line'> 21</span>  *
<span class='line'> 22</span>  * &lt;p>See also the &lt;a href="../../api/Bar.html">Bar guide&lt;/a>.
<span class='line'> 23</span>  *
<span class='line'> 24</span>  * @extends pv.Mark
<span class='line'> 25</span>  */</span><span class="WHIT">
<span class='line'> 26</span> </span><span class="NAME">pv.Bar</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 27</span> </span><span class="WHIT">  </span><span class="NAME">pv.Mark.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 28</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 29</span> 
<span class='line'> 30</span> </span><span class="NAME">pv.Bar.prototype</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">pv.extend</span><span class="PUNC">(</span><span class="NAME">pv.Mark</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 31</span> </span><span class="WHIT">    </span><span class="PUNC">.</span><span class="NAME">property</span><span class="PUNC">(</span><span class="STRN">"width"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Number</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 32</span> </span><span class="WHIT">    </span><span class="PUNC">.</span><span class="NAME">property</span><span class="PUNC">(</span><span class="STRN">"height"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Number</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 33</span> </span><span class="WHIT">    </span><span class="PUNC">.</span><span class="NAME">property</span><span class="PUNC">(</span><span class="STRN">"lineWidth"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Number</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 34</span> </span><span class="WHIT">    </span><span class="PUNC">.</span><span class="NAME">property</span><span class="PUNC">(</span><span class="STRN">"strokeStyle"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">pv.color</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 35</span> </span><span class="WHIT">    </span><span class="PUNC">.</span><span class="NAME">property</span><span class="PUNC">(</span><span class="STRN">"fillStyle"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">pv.color</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 36</span> 
<span class='line'> 37</span> </span><span class="NAME">pv.Bar.prototype.type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"bar"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 38</span> 
<span class='line'> 39</span> </span><span class="COMM">/**
<span class='line'> 40</span>  * The width of the bar, in pixels. If the left position is specified, the bar
<span class='line'> 41</span>  * extends rightward from the left edge; if the right position is specified, the
<span class='line'> 42</span>  * bar extends leftward from the right edge.
<span class='line'> 43</span>  *
<span class='line'> 44</span>  * @type number
<span class='line'> 45</span>  * @name pv.Bar.prototype.width
<span class='line'> 46</span>  */</span><span class="WHIT">
<span class='line'> 47</span> 
<span class='line'> 48</span> </span><span class="COMM">/**
<span class='line'> 49</span>  * The height of the bar, in pixels. If the bottom position is specified, the
<span class='line'> 50</span>  * bar extends upward from the bottom edge; if the top position is specified,
<span class='line'> 51</span>  * the bar extends downward from the top edge.
<span class='line'> 52</span>  *
<span class='line'> 53</span>  * @type number
<span class='line'> 54</span>  * @name pv.Bar.prototype.height
<span class='line'> 55</span>  */</span><span class="WHIT">
<span class='line'> 56</span> 
<span class='line'> 57</span> </span><span class="COMM">/**
<span class='line'> 58</span>  * The width of stroked lines, in pixels; used in conjunction with
<span class='line'> 59</span>  * &lt;tt>strokeStyle&lt;/tt> to stroke the bar's border.
<span class='line'> 60</span>  *
<span class='line'> 61</span>  * @type number
<span class='line'> 62</span>  * @name pv.Bar.prototype.lineWidth
<span class='line'> 63</span>  */</span><span class="WHIT">
<span class='line'> 64</span> 
<span class='line'> 65</span> </span><span class="COMM">/**
<span class='line'> 66</span>  * The style of stroked lines; used in conjunction with &lt;tt>lineWidth&lt;/tt> to
<span class='line'> 67</span>  * stroke the bar's border. The default value of this property is null, meaning
<span class='line'> 68</span>  * bars are not stroked by default.
<span class='line'> 69</span>  *
<span class='line'> 70</span>  * @type string
<span class='line'> 71</span>  * @name pv.Bar.prototype.strokeStyle
<span class='line'> 72</span>  * @see pv.color
<span class='line'> 73</span>  */</span><span class="WHIT">
<span class='line'> 74</span> 
<span class='line'> 75</span> </span><span class="COMM">/**
<span class='line'> 76</span>  * The bar fill style; if non-null, the interior of the bar is filled with the
<span class='line'> 77</span>  * specified color. The default value of this property is a categorical color.
<span class='line'> 78</span>  *
<span class='line'> 79</span>  * @type string
<span class='line'> 80</span>  * @name pv.Bar.prototype.fillStyle
<span class='line'> 81</span>  * @see pv.color
<span class='line'> 82</span>  */</span><span class="WHIT">
<span class='line'> 83</span> 
<span class='line'> 84</span> </span><span class="COMM">/**
<span class='line'> 85</span>  * Default properties for bars. By default, there is no stroke and the fill
<span class='line'> 86</span>  * style is a categorical color.
<span class='line'> 87</span>  *
<span class='line'> 88</span>  * @type pv.Bar
<span class='line'> 89</span>  */</span><span class="WHIT">
<span class='line'> 90</span> </span><span class="NAME">pv.Bar.prototype.defaults</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">pv.Bar</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 91</span> </span><span class="WHIT">    </span><span class="PUNC">.</span><span class="NAME">extend</span><span class="PUNC">(</span><span class="NAME">pv.Mark.prototype.defaults</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 92</span> </span><span class="WHIT">    </span><span class="PUNC">.</span><span class="NAME">lineWidth</span><span class="PUNC">(</span><span class="NUMB">1.5</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 93</span> </span><span class="WHIT">    </span><span class="PUNC">.</span><span class="NAME">fillStyle</span><span class="PUNC">(</span><span class="NAME">pv.Colors.category20</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">by</span><span class="PUNC">(</span><span class="NAME">pv.parent</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 94</span> </span></pre></body></html>